package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

func main() {
	client := &http.Client{}
	req, err := http.NewRequest("GET", "https://movie.douban.com/top250?start=0&filter=&qq-pf-to=pcqq.c2c", nil)
	if err != nil {
		log.Fatal(err)
	}
	//req.Header.Set("Connection", "keep-alive")
	//req.Header.Set("Pragma", "no-cache")
	//req.Header.Set("Cache-Control", "no-cache")
	//req.Header.Set("Upgrade-Insecure-Requests", "1")
	req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36")
	//req.Header.Set("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9")
	//req.Header.Set("Sec-Fetch-Site", "none")
	//req.Header.Set("Sec-Fetch-Mode", "navigate")
	//req.Header.Set("Sec-Fetch-User", "?1")
	//req.Header.Set("Sec-Fetch-Dest", "document")
	//req.Header.Set("Accept-Language", "zh-CN,zh;q=0.9")
	//req.Header.Set("Cookie", "bid=7KQOdNrdDds; douban-fav-remind=1; __utmc=30149280; __utmz=30149280.1589357652.3.3.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; _pk_ses.100001.4cf6=*; __utma=30149280.555493943.1586759700.1589357652.1593334037.4; __utmb=30149280.0.10.1593334037; __yadk_uid=9PlKUhSWHFu3QJBSwqkUgpZIVvuX2jvc; _pk_id.100001.4cf6=14580ff41631e832.1593334036.1.1593334071.1593334036.")
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	bodyText, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s\n", bodyText)
}
